package org.vartist.atld.menu.adapter.util.log;

import java.util.ArrayList;

import org.vartist.atld.R;
import org.vartist.atld.menu.vo.util.log.LogVO;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class LogAdapter extends ArrayAdapter<LogVO> {
	
	private Activity mActivity = null;
	private ArrayList<LogVO> mLogList = null;
	private int mLogListItemView;
	
	private LayoutInflater mInflater = null;
	private View mCustomCell = null;
	private TextView mTxtLogContent = null;
	
	public LogAdapter(Activity activity, int logListItemView, ArrayList<LogVO> logList) {
		super(activity, logListItemView, logList);
		
		mActivity = activity;
		mLogList = logList;
		mLogListItemView = logListItemView;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		mInflater = mActivity.getLayoutInflater();
		mCustomCell = mInflater.inflate(mLogListItemView, null);
		
		LogVO logVO = mLogList.get(position);
		mTxtLogContent = (TextView) mCustomCell.findViewById(R.id.txtLogContent);
		mTxtLogContent.setText(logVO.getLogContent());
		
		return mCustomCell;
	}

}
